<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<script>
  function Supper(name, age) {
    this.name = name;
    this.age = age;
  }
  Supper.prototype.study = function(course) {
    console.log(`(${this.name})正在学习(${course || ''})中...1`);
  }

  function Sub(name, age, score) {
    Supper.call(this, name, age);
    this.score = score;
  }

  console.log('sub--->', Sub);
  console.log('Sub.prototype.constructor--->', Sub.prototype.constructor); // Sub
  // console.log('Sub.constructor--->', Sub.constructor); // Function
  // console.log(Sub.constructor === Sub.prototype.constructor); // false
  console.log('-------------------------------');
  Sub.prototype = new Supper();
  console.log('Sub.prototype.constructor--->', Sub.prototype.constructor); // Sub
  Sub.prototype.constructor = Sub;
  var sub = new Sub('小明', 10, 90);


  console.log('-------------------------------');
  console.log(sub);
  console.log('sub instanceof Object--->', sub instanceof Object); // true
  sub.study();
  sub.study('数学');
</script>

</body>
</html>
